:root,
:host {
  --van-field-label-width: 6.2em;
  --van-field-label-color: var(--van-text-color);
  --van-field-label-margin-right: var(--van-padding-sm);
  --van-field-input-text-color: var(--van-text-color);
  --van-field-input-error-text-color: var(--van-danger-color);
  --van-field-input-disabled-text-color: var(--van-text-color-3);
  --van-field-placeholder-text-color: var(--van-text-color-3);
  --van-field-icon-size: 18px;
  --van-field-clear-icon-size: 18px;
  --van-field-clear-icon-color: var(--van-gray-5);
  --van-field-right-icon-color: var(--van-gray-6);
  --van-field-error-message-color: var(--van-danger-color);
  --van-field-error-message-font-size: 12px;
  --van-field-text-area-min-height: 60px;
  --van-field-word-limit-color: var(--van-gray-7);
  --van-field-word-limit-font-size: var(--van-font-size-sm);
  --van-field-word-limit-line-height: 16px;
  --van-field-disabled-text-color: var(--van-text-color-3);
  --van-field-required-mark-color: var(--van-red);
}

.van-field {
  flex-wrap: wrap;

  &__label {
    flex: none;
    box-sizing: border-box;
    width: var(--van-field-label-width);
    margin-right: var(--van-field-label-margin-right);
    color: var(--van-field-label-color);
    text-align: left;
    word-wrap: break-word;

    &--center {
      text-align: center;
    }

    &--right {
      text-align: right;
    }

    &--top {
      display: flex;
      width: 100%;
      text-align: left;
      margin-bottom: var(--van-padding-base);
      overflow-wrap: break-word;
    }

    &--required {
      &::before {
        margin-right: 2px;
        color: var(--van-field-required-mark-color);
        content: '*';
      }
    }
  }

  &--disabled {
    .van-field__label {
      color: var(--van-field-disabled-text-color);
    }
  }

  &__value {
    overflow: visible;
  }

  &__body {
    display: flex;
    align-items: center;
  }

  &__control {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0; // for flex-shrink in field__button
    margin: 0;
    padding: 0;
    color: var(--van-field-input-text-color);
    line-height: inherit;
    text-align: left;
    background-color: transparent;
    border: 0;
    resize: none;
    // https://github.com/vant-ui/vant/pull/9418
    user-select: auto;

    &::placeholder {
      color: var(--van-field-placeholder-text-color);
    }

    &:read-only {
      cursor: default;
    }

    &:disabled {
      color: var(--van-field-input-disabled-text-color);
      cursor: not-allowed;
      opacity: 1;
      // fix disabled color in mobile safari
      -webkit-text-fill-color: var(--van-field-input-disabled-text-color);
    }

    &--center {
      justify-content: center;
      text-align: center;
    }

    &--right {
      justify-content: flex-end;
      text-align: right;
    }

    &--custom {
      display: flex;
      align-items: center;
      min-height: var(--van-cell-line-height);
    }

    &--error,
    &--error::placeholder {
      color: var(--van-field-input-error-text-color);
      -webkit-text-fill-color: currentColor;
    }

    &--min-height {
      min-height: var(--van-field-text-area-min-height);
    }

    // for ios wechat
    &[type='date'],
    &[type='time'],
    &[type='datetime-local'] {
      min-height: var(--van-cell-line-height);
    }

    // for safari
    &[type='search'] {
      -webkit-appearance: none;
    }
  }

  &__clear,
  &__icon,
  &__button,
  &__right-icon {
    flex-shrink: 0;
  }

  &__clear,
  &__right-icon {
    margin-right: calc(var(--van-padding-xs) * -1);
    padding: 0 var(--van-padding-xs);
    line-height: inherit;
  }

  &__clear {
    color: var(--van-field-clear-icon-color);
    font-size: var(--van-field-clear-icon-size);
    cursor: pointer;
  }

  &__left-icon .van-icon,
  &__right-icon .van-icon {
    display: block;
    font-size: var(--van-field-icon-size);
    line-height: inherit;
  }

  &__left-icon {
    margin-right: var(--van-padding-base);
  }

  &__right-icon {
    color: var(--van-field-right-icon-color);
  }

  &__button {
    padding-left: var(--van-padding-xs);
  }

  &__error-message {
    color: var(--van-field-error-message-color);
    font-size: var(--van-field-error-message-font-size);
    text-align: left;

    &--center {
      text-align: center;
    }

    &--right {
      text-align: right;
    }
  }

  &__word-limit {
    margin-top: var(--van-padding-base);
    color: var(--van-field-word-limit-color);
    font-size: var(--van-field-word-limit-font-size);
    line-height: var(--van-field-word-limit-line-height);
    text-align: right;
  }
}
